package Exercise;

/**
 * @author 王艺锡
 * @version 1.0
 */
public class Exercise02 {
    public static void main(String[] args) {
        System.out.println(Fork.getNextNum());
        System.out.println(Fork.getNextNum());

        Fork fork = new Fork();
        Fork fork1 = new Fork();
        Fork fork2 = new Fork();
        System.out.println(fork.getSerialNumber());
        System.out.println(fork1.getSerialNumber());
        System.out.println(fork2.getSerialNumber());
    }
}
class Fork{
    private static int currentNum = 100000;
    private int serialNumber;

    public int getSerialNumber() {
        return serialNumber;
    }

    public Fork() {
        serialNumber = getNextNum();
    }

    public static int  getNextNum(){
        return currentNum += 100;
    }


}
